<template>
  <div>
    <input type="text" v-model="val" />
    <ul>
      <li v-for="i in arrnew">
          {{i}}
      </li>
    </ul>
  </div>
</template>
<script>
export default {
  data() {
    return {
      arr: ["阿迪鞋子", "安踏鞋子", "耐克鞋子", "乔丹鞋子"],
      val: "",
      arrnew:[]
    };
  },
  watch: {
    val() {
        this.arrnew=[]
      this.arr.forEach(item=> {
          if(this.val){
              if(item.indexOf(this.val)!=-1){
                  this.arrnew.push(item)
              }
          }
      })
    },
  },
};
</script>
